package com.zjw.starter.fegin;

import com.zjw.model.R;
import com.zjw.model.enums.ClientType;
import com.zjw.model.pojo.vo.WsNodeInfo;
import com.zjw.starter.fegin.factory.RemoteRegisterServiceFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;

@FeignClient(contextId = "remoteAuthService", value = "${ws.register.serviceName}", fallbackFactory = RemoteRegisterServiceFactory.class)
public interface RemoteRegisterService {

    @GetMapping("/ws/getServersByUserId")
    R<Collection<WsNodeInfo>> getServersByUserId(@RequestParam String groupId, @RequestParam String userId);

    @GetMapping("/ws/getServerByClientType")
    R<WsNodeInfo> getServerByClientType(@RequestParam String groupId, @RequestParam String userId, @RequestParam ClientType clientType);
}
